package com.smart.ZC.Tools;

public class gameKey {
	public static boolean KeyDown;
	public static boolean KeyUp;
	private static byte keyPressed;
	private static byte keyPrePressed;

	public gameKey() {

	}

	public static void keyUpdate() {
		keyPressed &= ~keyPressed;
		keyPressed = keyPrePressed;
		keyPrePressed &= ~keyPrePressed;
	}

	public static void setKeyPressed(byte key) {
		keyPrePressed |= key;
	}

	public static void clearKeyPressed(byte key) {
		keyPressed &= key;
	}

	public static boolean IsKeyPressed(byte key) {
		return (keyPressed & key) != 0;
	}

	public static void keyInit() {
		keyPressed = 0;
	}
}
